import request from '@/api/request.js'


export default {
  // 订单list
  OrderList(form){
    return request({
      url:'/wOrder/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{}
    })
  },

  // 销售list
  SellList(form){
    return request({
      url:'/wSale/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{}
    })
  },

  // 原料list
  MaterialList(form){
    return request({
      url:'/wMaterial/query/'+form.currentPage+'/'+form.pageSize,
      method:'post',
      data:{}
    })
  },

  // 订单删除
  OrderDelete(orderId){
    return request({
      url:'/wOrder/delete',
      method:'post',
      data:{
        orderId
      }
    })
  },
  // 销售删除
  SellDelete(saleId){
    return request({
      url:'/wSale/delete',
      method:'post',
      data:{
        saleId
      }
    })
  },
  // 原料删除
  MaterialDelete(materialId){
    return request({
      url:'/wMaterial/delete',
      method:'post',
      data:{
        materialId
      }
    })
  },

  // 订单更新
  orderUpdate(row){
    return request({
      url:'/wOrder/update',
      method:'post',
      data:{
        orderId:row.orderId,
        orderTime:row.orderTime,
        orderName:row.orderName,
        orderQuantity:row.orderQuantity,
        orderStatus:row.orderStatus,
        completionRate:row.completionRate,
        timeConsuming:row.timeConsuming
      }
    })
  },
  // 销售更新
  sellUpdate(row){
    return request({
      url:'/wSale/update',
      method:'post',
      data:{
        saleId:row.saleId,
        saleTime:row.saleTime,
        product:row.product,
        province:row.province,
        quantity:row.quantity,
        amount:row.amount
      }
    })
  },
  // 原料更新
  materialUpdate(row){
    return request({
      url:'/wMaterial/update',
      method:'post',
      data:{
        materialId:row.materialId,
        materialTime:row.materialTime,
        product:row.product,
        quantity:row.quantity
      }
    })
  },

  // 订单插入
  orderInsert(form){
    return request({
      url:'/wOrder/insert',
      method:'post',
      data:{
        orderId:form.orderId,
        orderTime:form.orderTime,
        orderName:form.orderName,
        orderQuantity:form.orderQuantity,
        orderStatus:form.orderStatus,
        completionRate:form.completionRate,
        timeConsuming:form.timeConsuming
      }
    })
  },

  // 销售插入
  sellInsert(form){
    return request({
      url:'/wSale/insert',
      method:'post',
      data:{
        // saleId:form.saleId,
        saleTime:form.saleTime,
        product:form.product,
        province:form.province,
        quantity:form.quantity,
        amount:form.amount
      }
    })
  },
  // 原料插入
  materialInsert(form){
    return request({
      url:'/wMaterial/insert',
      method:'post',
      data:{
        materialId:form.materialId,
        materialTime:form.materialTime,
        product:form.product,
        quantity:form.quantity
      }
    })
  },

}
